package cn.pping.basic.mapper;

import cn.pping.basic.query.BaseQuery;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
@Mapper
public interface BaseMapper<T> {
    /*
     * @Title:
     * @Description: 这个查询所有
     * @Author: Pan
     * @Version: 1.0
     * @Date:  2022/6/21 19:21
     * @Parameters:
     * @Return
     */
    List<T> loadAll();

    /*
     * @Title:
     * @Description: 通过ID查询
     * @Author: Pan
     * @Version: 1.0
     * @Date:  2022/6/21 19:22
     * @Parameters:
     * @Return
     */
    T loadById(Long id);

    /*
     * @Title:
     * @Description: 根据ID删除
     * @Author: Pan
     * @Version: 1.0
     * @Date:  2022/6/21 19:23
     * @Parameters:
     * @Return
     */

    void remove(Long id);

    /*
     * @Title:
     * @Description: 新增
     * @Author: Pan
     * @Version: 1.0
     * @Date:  2022/6/21 19:23
     * @Parameters:
     * @Return
     */
    void save(T t);

    /*
     * @Title:
     * @Description: 修改
     * @Author: Pan
     * @Version: 1.0
     * @Date:  2022/6/21 19:23
     * @Parameters:
     * @Return
     */

    void update(T t);

    /*
     * @Title:
     * @Description: 高级查询和分页
     * @Author: Pan
     * @Version: 1.0
     * @Date:  2022/6/21 19:24
     * @Parameters:
     * @Return
     */

    List<T> queryData(BaseQuery baseQuery);

    /*
     * @Title:
     * @Description: 查询总条数
     * @Author: Pan
     * @Version: 1.0
     * @Date:  2022/6/21 19:24
     * @Parameters:
     * @Return
     */

    Integer queryCount(BaseQuery baseQuery);

    /*
     * @Title:
     * @Description: 批量删除方法
     * @Author: Pan
     * @Version: 1.0
     * @Date:  2022/6/26 1:20
     * @Parameters:
     * @Return
     */

    void batch(List<Long> ids);
}
